Skip to content

Fix WebAppAuthSettingsV2 deletion#4373

Merged
EronWright merged 4 commits into
masterfrom
fix-webappauthsettingsv2-deletion
Oct 24, 2025
Merged

Fix WebAppAuthSettingsV2 deletion#4373
EronWright merged 4 commits into
masterfrom
fix-webappauthsettingsv2-deletion

Conversation

@EronWright

Copy link
Copy Markdown
Contributor

Summary

Fixes #4330

This PR fixes the deletion of azure-native:web:WebAppAuthSettingsV2 and azure-native:web:WebAppAuthSettingsV2Slot resources, which were failing with:

Status=400 Message="The parameter properties has an invalid value."

Root Cause

The Azure REST API does not support DELETE operations for these singleton child resources (the spec shows delete: null). Instead, they must be "reset" to their default state via a PUT operation.

Solution

Added both resources to provider/pkg/openapi/defaults/defaultResourcesState.go, following the same pattern used to fix WebAppAuthSettings (V1) in PR #1160.

When Pulumi destroys these resources, it now sends:

PUT .../config/authsettingsV2
{
  "platform": {
    "enabled": false
  }
}

This resets the auth settings to their disabled state instead of attempting a DELETE.

Testing

✅ Verified with TestAccAppServiceTs - the test now passes completely including the destroy operation that was previously failing.

Changes

  • Added WebAppAuthSettingsV2 (main site)
  • Added WebAppAuthSettingsV2Slot (slot configuration)
  • Both now use the same deletion pattern as V1

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

Fixes #4330

This fixes the deletion of `azure-native:web:WebAppAuthSettingsV2` and
`azure-native:web:WebAppAuthSettingsV2Slot` resources, which were failing
with "Status=400 Message='The parameter properties has an invalid value.'"

The Azure REST API does not support DELETE operations for these singleton
child resources. Instead, they must be "reset" to their default state via
a PUT operation.

This fix adds both resources to `defaultResourcesState.go`, following
the same pattern used to fix `WebAppAuthSettings` (V1) in PR #1160.

When Pulumi destroys these resources, it now sends:
```
PUT .../config/authsettingsV2
{
  "platform": {
    "enabled": false
  }
}
```

This resets the auth settings to their disabled state instead of
attempting a DELETE, which the API rejects.

Tested with `TestAccAppServiceTs` - the test now passes completely
including the destroy operation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@EronWright EronWright requested a review from a team October 23, 2025 21:26
@github-actions

Copy link
Copy Markdown
Contributor

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@Graham-Pedersen Graham-Pedersen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@guineveresaenger guineveresaenger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the broken test for me locally.

Question:

Do we need to generate the SDKs before merging? Still getting familiar with the workflow here!

@codecov

codecov Bot commented Oct 23, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.87%. Comparing base (a1d0f34) to head (451bbcc).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4373      +/-   ##
==========================================
+ Coverage   59.79%   60.87%   +1.08%     
==========================================
  Files          91       91              
  Lines       14243    11448    -2795     
==========================================
- Hits         8516     6969    -1547     
+ Misses       5064     3815    -1249     
- Partials      663      664       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

EronWright and others added 2 commits October 23, 2025 14:48
The workaround added in PR #4349 is no longer needed now that the
proper provider-level fix is in place via defaultResourcesState.go.

The test passes successfully without this workaround.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Regenerate SDKs to pick up WebAppAuthSettingsV2 changes and new
WithoutSecrets resources.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@EronWright EronWright enabled auto-merge (squash) October 23, 2025 21:59
@EronWright EronWright disabled auto-merge October 23, 2025 23:06
@EronWright EronWright enabled auto-merge (squash) October 23, 2025 23:06
Add GITHUB_TOKEN to the workflow-level environment variables section
to make it available globally across all jobs and steps that interact
with the GitHub API, preventing rate limiting issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@EronWright EronWright merged commit b9e6728 into master Oct 24, 2025
25 checks passed
@EronWright EronWright deleted the fix-webappauthsettingsv2-deletion branch October 24, 2025 00:02
@pulumi-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped in release v3.10.0.

3 similar comments
@pulumi-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped in release v3.10.0.

@pulumi-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped in release v3.10.0.

@pulumi-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped in release v3.10.0.

EronWright added a commit that referenced this pull request Nov 26, 2025
Adds WebAppAuthSettingsV2 and WebAppAuthSettingsV2Slot to defaultResourcesState.go
so the provider resets auth settings via PUT instead of attempting DELETE.

Removes the platform property workaround from the example since the provider
now handles deletion correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workflow failure: master

4 participants